<?php

 class Application_Model_Movies_Filmy extends Zend_Db_Table_Abstract {
     protected $_name = 'filmysd';
     protected $_name2 = 'filmyhd';
     
     public function filmysd(){
     	$db = Zend_Db_Table::getDefaultAdapter();
     	$select = $db->select();
     	$select->from('movie');
     	$select->where('idmovietype = ?',"1");
     	$filmysd = $db->fetchAll($select);
     	return $filmysd;
     }
     
         
     public function filmyhd(){
     	$db = Zend_Db_Table::getDefaultAdapter();
     	$select = $db->select();
     	$select->from('movie');
     	$select->where('idmovietype = ?',"2");
     	$filmyhd = $db->fetchAll($select);
     	return $filmyhd;
     }
     public function filmyhdfree(){
     	$db = Zend_Db_Table::getDefaultAdapter();
     	$select = $db->select();
     	$select->from('movie');
     	$select->where('idmovietype = ?',"2");
     	$filmyhdfree = $db->fetchAll($select);
     	return $filmyhdfree;
     }
     public function seriale(){
     	$db = Zend_Db_Table::getDefaultAdapter();
     	$select = $db->select();
     	$select->from('movie');
     	$select->where('idmovietype = ?',"3");
     	$seriale = $db->fetchAll($select);
     	return $seriale;
     }
     public function junior(){
     	$db = Zend_Db_Table::getDefaultAdapter();
     	$select = $db->select();
     	$select->from('movie');
     	$select->where('idmovietype = ?',"4");
     	$junior = $db->fetchAll($select);
     	return $junior;
     }
     public function filmytypgatunek($genre,$typ){
     	$db = Zend_Db_Table::getDefaultAdapter();
     	$select = $db->select();
     	$select->from('movie');
        $select->where('idmovietype = ?',$typ);
     	$select->where('idgenre = ?',$genre);
     	$gatunek = $db->fetchAll($select);
     	return $gatunek;
     }
     
     public function typfilmu($idfilmu){
        $db = Zend_Db_Table::getDefaultAdapter();
     	$select = $db->select();
     	$select->from('movie');
     	$select->where('idmovie = ?',$idfilmu);
     	$film = $db->fetchAll($select);
     	return $film;
     }
 }